home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.19990725-20000114
/
000249_news@columbia.edu _Sat Oct 30 15:58:51 1999.msg
< prev
next >
Wrap
Internet Message Format
|
2000-01-13
|
2KB
Return-Path: <news@columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id PAA01538
for <kermit.misc@watsun.cc.columbia.edu>; Sat, 30 Oct 1999 15:58:50 -0400 (EDT)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id PAA28506
for kermit.misc@watsun.cc.columbia.edu; Sat, 30 Oct 1999 15:33:35 -0400 (EDT)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Subject: Re: Q: can kermit interface with other programs ?
Date: 30 Oct 1999 19:33:34 GMT
Organization: Columbia University
Message-ID: <7vfh6e$rql$1@newsmaster.cc.columbia.edu>
To: kermit.misc@columbia.edu
In article <7vdj78$nu6$1@nnrp1.deja.com>, <tilmanglotzner@my-deja.com> wrote:
: Can kermit read the exit codes of programs it kicks off ?
:
It depends on which Kermit program and version, on which operating system.
: I am doing a download with kermit, and I want a perl program to do some
: post processing on that. The perl program is kicked of from kermit, and
: currently kermit gets the status of the perl program by flag files.
: Interfacing with exit codes would be more elegant.
:
If this is some form of UNIX, then C-Kermit 7.0 can do this:
http://www.columbia.edu/kermit/ck70.html
Example: Here is a file 'foo' that contains three lines:
$ cat foo
abc
mno
xyz
$
Running grep from Kermit for a line that is in the file succeeds:
$ kermit
C-Kermit>define xx !grep \%1 foo, status, show var pexitstat
C-Kermit>xx abc
abc
SUCCESS
\v(pexitstat) = 0
C-Kermit>
And doing the same for a line that isn't there fails:
C-Kermit>xx blah
FAILURE
\v(pexitstat) = 1
C-Kermit>
Thus IF SUCCESS or IF FAILURE can be used to test the success or failure
reported by the external command, and the variable \v(pexitstat) contains
its actual exit status code.
This didn't work very well in earlier C-Kermit releases.
- Frank